package com.yoomiito.app.ui.my.income

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import com.yoomiito.app.base.App
import com.yoomiito.app.model.bean.TabBean
import com.yoomiito.app.ui.my.MyOrderBaseActivity
import com.yoomiito.app.utils.Const

/**
 * 预计结算
 */
class IncomeForecastActivity : MyOrderBaseActivity<IncomeForecastPresenter>() {
    companion object{
        const val TAOBAO = 1
        const val JINGDONG = 2
        const val CreditCard = 3
        fun start(context:Context,pageType:Int){
            val intent = Intent(context,IncomeForecastActivity::class.java)
            intent.putExtra(Const.Common.Type,pageType)
            context.startActivity(intent)
        }
    }

    private var mPageType:Int = TAOBAO

    override fun newP(): IncomeForecastPresenter = IncomeForecastPresenter(App.mAppConfig)

    override fun initData(savedInstanceState: Bundle?) {
        mPageType = intent.getIntExtra(Const.Common.Type, TAOBAO)
        super.initData(savedInstanceState)
        desTv.visibility = View.VISIBLE
        desTitleTv.text = "待结算收益"
        when(mPageType){
            TAOBAO-> {
                titleView.setCenterText("淘宝结算预计")
                desTv.text = "每个月25号结算上个月确认收货的淘宝订单"
            }
            JINGDONG-> {
                titleView.setCenterText("京东结算预计")
                desTv.text = "每个月25号结算上个月确认收货的京东订单"
            }
            CreditCard->{
                titleView.setCenterText("智能用卡结算预计")
                desTv.text = "每个月25号结算上个月产生的智能用卡订单"
            }
        }
    }

    override fun getAllFragment(): MutableList<RevenueRelatedOrdersFragment> {
        val fm = RevenueRelatedOrdersFragment()
        val bundle = Bundle()
        bundle.putInt(Const.Common.Type,mPageType)
        fm.arguments = bundle
        return mutableListOf(fm)
    }

    override fun getTabList(): MutableList<TabBean>? = null

}